decimal
only forth also library definitions
lib-init
2      createlabels
\ MR3031_PF1 FILE:c:\smis\seqlib\RFstd.seq
\ IMAGE SEQUENCE FILE:c:\smis\seqlib\g3040_15.seq
VARIABLE NO_ECHOES
VARIABLE CURRENT_ECHO
VARIABLE NO_SLICES
VARIABLE CURRENT_SLICE
VARIABLE SLICE_INTERLEAVE
VARIABLE BATCH_SLICES 0 BATCH_SLICES !
VARIABLE BATCH_INTERLEAVE 1 BATCH_INTERLEAVE !
VARIABLE NO_AVERAGES
VARIABLE IMAGE_AV
VARIABLE NO_VIEWS
VARIABLE CURRENT_VIEW
VARIABLE JUMP
VARIABLE ECHO_CNT
VARIABLE SAMPLE_PERIOD
VARIABLE NO_SAMPLES
VARIABLE NO_DISCARD
VARIABLE TDISCARD
VARIABLE VIEW_BLOCK
VARIABLE VIEW_AV
VARIABLE VIEWS_PER_SEG
VARIABLE SLICE_BLOCK
VARIABLE SLICE_AV
VARIABLE PHASE_CYCLE
VARIABLE NO_ACQ
VARIABLE DC_SHFT
\ COMMON OBS_MOD_LEVEL 0 f
VARIABLE TEMP_MAC
2VARIABLE TEMP_MAC_LONG
VARIABLE FAST_FILTERS
VARIABLE TEXTRA
VARIABLE TE_MS_2
VARIABLE TE_US_2
VARIABLE ASYMM
VARIABLE DEL1
VARIABLE GROUP_DELAY
VARIABLE TRMIN
VARIABLE CLOCK
VARIABLE TFILTER 373 TFILTER !
VARIABLE TREF
VARIABLE TIME
VARIABLE TR_EXTEND
VARIABLE TR_MS
VARIABLE TR_US
VARIABLE TE_MS
VARIABLE TE_US
VARIABLE RET
VARIABLE T_REFOCUS
VARIABLE T_REFOCUS_2
\ COMMON TR 2 f
\ COMMON TE 4 f
\ COMMON TE_2 6 f
\ COMMON TE_EFF 8 f
\ COMMON REPORT_ON a f
2VARIABLE TACQ
2VARIABLE TACQ_2
2VARIABLE TEMPL1
2VARIABLE TEMPL2
2VARIABLE TEMPL3
2VARIABLE TEMPL4
2VARIABLE TEMPL5
2VARIABLE TR_MIN
2VARIABLE TASS
\ COMMON T_GS_COMP c f
\ COMMON TCRUSH e f
VARIABLE RF_SP_ANGLE
VARIABLE DEG_90
VARIABLE DEG_117
VARIABLE RFSP_ON
2VARIABLE RF_INC
2VARIABLE RF_SP_TEMP
VARIABLE PHASE_ANG
VARIABLE DEG_360
VARIABLE OVERHEAD
VARIABLE REMAINDER_PHASE
VARIABLE PHASE_CORRECTION
VARIABLE PHASE_CORRECTION_0
VARIABLE PHASE_CORRECTION_1
VARIABLE PHASE_CORRECTION_2
\ COMMON RF_ON 10 f
\ COMMON SUBJ_ANGLE_X 12 f
\ COMMON SUBJ_ANGLE_Y 14 f
\ COMMON SUBJ_ANGLE_Z 16 f
\ COMMON RFCAL 18 f
\ COMMON MHZ 1a f
\ COMMON KHZ 1c f
\ COMMON HZ 1e f
\ COMMON RX1MHZ 20 f
\ COMMON REC_FREQ 22 f
VARIABLE PULSE_BWDTH
VARIABLE SLICE_OFFSET
VARIABLE SLICE_OFF_FREQ
VARIABLE KHZ_NEW
VARIABLE HZ_NEW
VARIABLE KHZ_NEW2
VARIABLE HZ_NEW2
VARIABLE KHZ_NEW3
VARIABLE HZ_NEW3
2VARIABLE SLICE_FREQ_LONG
2VARIABLE READ_FREQ_LONG
\ COMMON GATING 24 f
\ COMMON CARDIAC_DEL 26 f
VARIABLE FLOW_COMP_ON
VARIABLE PE_FLOW
VARIABLE PE_FLOW_SEC
VARIABLE GR_FLOW
VARIABLE GS_FLOW
VARIABLE FLOW_MAT
VARIABLE T_FLOW_1
VARIABLE T_FLOW_2
VARIABLE T_FLOW_TEMP
VARIABLE SLICE_LIST_1
VARIABLE SLICE_LIST_2
VARIABLE REF_LIST
\ COMMON MTC_ON 28 f
\ COMMON MTC_DELAY 2a f
\ COMMON MTC_SCALE 2c f
\ COMMON MTC_FREQ 2e f
\ COMMON MTC_TCRUSH 30 f
\ COMMON MTC_GR_AMP 32 f
VARIABLE MTC_DELAY_CAL
VARIABLE TSELMTC
VARIABLE MTC_DELAY_MIN
VARIABLE MTC_RFNUM
VARIABLE MTC_AMP
VARIABLE MTC_MAT
VARIABLE MTC_LIST
\ COMMON P_SAT_SCALE 34 f
\ COMMON SAT_TCRUSH 36 f
\ COMMON SAT_GR_AMP 38 f
VARIABLE RFNUM_SAT
VARIABLE TSEL_SAT
VARIABLE SAT_PULSE_BWDTH
VARIABLE FOV_SAT_SLICE_FREQ
VARIABLE SAT_CRUSH_AMP
VARIABLE SATGS_ON
VARIABLE SAT_LIST
VARIABLE SAT_CHANNEL
VARIABLE GS_SAT
VARIABLE P_SAT_MUL
VARIABLE SAT_MAT
VARIABLE SAT_MAT_2
VARIABLE SAT_ORIENT
VARIABLE SAT_FOV_SCALE
2VARIABLE SAT_SLICE_FREQ_LONG
VARIABLE PE_REPHASE_ON
VARIABLE GRAD_SPOIL_ON
VARIABLE GRAD_SPOIL_AMP
VARIABLE SLICE_REPHASE
\ COMMON GRAD_AMP 3a f
VARIABLE SLICE_LIST
VARIABLE READ_LIST
VARIABLE PHASE_LIST
VARIABLE REFOCUS_LIST
VARIABLE CRUSH_LIST
VARIABLE SCALE_READ_OFF
VARIABLE SCALE_PHASE_OFF
VARIABLE SCALE_SLICE_OFF
VARIABLE FOV_READ_FREQ
VARIABLE FOV_PHASE_DEG
VARIABLE FOV_SLICE_FREQ
VARIABLE NEW_SLICE_OFFSET
VARIABLE GP_INC
VARIABLE GP_VAR
VARIABLE DACMAX 32767 DACMAX !
VARIABLE GP_INIT_VAR_RESCALE
VARIABLE GS_VAR_RESCALE
VARIABLE OVERSAMPLE
VARIABLE OVERSAMPLE2
VARIABLE GR_OVERSAMPLE
VARIABLE GR_UNDERSAMPLE
VARIABLE GP_OVERSAMPLE
VARIABLE GP_UNDERSAMPLE
4 CREATE-ARRAY GRAD_VAR
4 CREATE-ARRAY GRAD_VAR_L
VARIABLE TRAMP
VARIABLE GP_INIT_VAR
VARIABLE GR_VAR
VARIABLE GR_VAR_S
VARIABLE GS_VAR
VARIABLE GR_COMP
VARIABLE GR_COMP_S
VARIABLE GS_COMP
VARIABLE GS_COMP_S
VARIABLE GR_CRUSH
VARIABLE GS_CRUSH
VARIABLE GP_CRUSH
2VARIABLE DACMAXLONG 0x7fff 0x0 DACMAXLONG 2!
\ COMMON GR_COMP_SCALE 3c f
\ COMMON GS_COMP_SCALE 3e f
\ COMMON GR_ON 40 f
\ COMMON GP_ON 42 f
\ COMMON GS_ON 44 f
VARIABLE PHASE_90
VARIABLE PHASE_180
VARIABLE PHASE_117
VARIABLE TSEL90
VARIABLE TSEL180
\ COMMON P90_MUL 46 f
\ COMMON P180_MUL 48 f
VARIABLE WARMUP 20 WARMUP !
VARIABLE PHASE_RES 225 PHASE_RES !
VARIABLE RFNUM
VARIABLE PHASE_REC
VARIABLE PHASE_REC_CAL1
VARIABLE PHASE_REC_CAL2
32 CREATE-ARRAY RF_LENGTH
32 CREATE-ARRAY RF_BWDTH
32 CREATE-ARRAY RAD
32 CREATE-ARRAY RWT
32 CREATE-ARRAY RBD
\ COMMON P180_SCALE 4a f
\ COMMON ALPHA 4c f
VARIABLE FOV_READ_OFF
VARIABLE FOV_PHASE_OFF
VARIABLE FOV_SLICE_OFF
\ COMMON PHASE_VAR 4e f
\ COMMON S_ANGLE_VAR 50 f
\ COMMON P_ANGLE_VAR 52 f
\ COMMON R_ANGLE_VAR 54 f

VARIABLE MD_TDEL
VARIABLE MD_CLOCK
VARIABLE MD_ADDR
: MR3040_DELAY
MD_ADDR !
MD_CLOCK !
MD_TDEL !
MD_CLOCK @
   
10 noop
 >
IF
MD_TDEL @
10 noop
MD_CLOCK @
 */
MD_TDEL !
THEN
MD_TDEL @
   
 [ 56832 , 4095 , ]
 >
IF
BEGIN
0 noop
MD_ADDR @
1 noop
 [ 56832 , 4095 , ]
MR3040_OUTPUT
MD_TDEL @
   
 [ 56832 , 4095 , ]
 -
MD_TDEL !
MD_TDEL @
   
 [ 56832 , 4095 , ]
 > NOT
 UNTIL
THEN
0 noop
MD_ADDR @
1 noop
MD_TDEL @
MR3040_OUTPUT
 ;
VARIABLE TEMP_3040

VARIABLE CMT_MAT
VARIABLE CMT_S
VARIABLE CMT_P
VARIABLE CMT_R
VARIABLE CMT_I
: CREATEMATRIXTEST
CMT_R !
CMT_P !
CMT_S !
CMT_MAT !
CMT_MAT @
DACMAX @
CMT_S @
DACMAX @
CMT_P @
DACMAX @
CMT_R @
[ 56832 , 78 , ] 15 f@
[ 56832 , 80 , ] 15 f@
[ 56832 , 82 , ] 15 f@
[ 56832 , 84 , ] 15 f@
MR3040_CREATEMATRIX
CMT_I !
CMT_I @
IF
." Failed to create matrix = "
CMT_MAT @
 .
." , return code = "
CMT_I @
 .
 CR
THEN
CMT_I @
EXIT
 ;
26 CONST-LIT TEXEC1
VARIABLE TRDD
VARIABLE TRADD
VARIABLE TRDDEXTEND
VARIABLE COMPLETED_AV
VARIABLE TREXTEND
\ COMMON P90 56 f
\ COMMON P90_AMP 58 f
VARIABLE TEMP
: MAIN STREAMON DECIMAL
PHASE_CYCLE @
   
2 noop
 =
IF
NO_AVERAGES @
   
1 noop
 AND
   
0 noop
 !=
IF
 CR
." No. Averages is not a multiple of 2"
                                      XGOTO 0
THEN
THEN
PHASE_CYCLE @
   
4 noop
 =
IF
NO_AVERAGES @
   
3 noop
 AND
   
0 noop
 !=
IF
 CR
." No. Averages is not a multiple of 4"
                                      XGOTO 0
THEN
THEN
NO_SAMPLES @
   
NO_DISCARD @
 +
SAMPLE_PERIOD @
 [ 56832 , 10000 , ]
 */
S>D
TACQ 2!
TACQ q2@
2 noop
S>D
 D+
DROP
TRADD !
TRDD @
   
TEXEC1
 -
   
 [ 56832 , 33 , ]
 -
TRDDEXTEND !
TRDDEXTEND @
   
4 noop
 <
IF
 CR
." Ring down delay time "
TRDDEXTEND @
   
4 noop
 -
 0-
 .
."  us too short"
                                      XGOTO 0
THEN
 [ 56832 , 400 , ]
PHASE_INCREMENT
NO_DISCARD @
DISCARD
0 noop
0 noop
 [ 56832 , -232 , ]
Set_board_Multipliers
0 noop
0 noop
 [ 56832 , -240 , ]
Set_board_Multipliers
2 noop
20 noop
 [ 56832 , -236 , ]
 [ 56832 , -228 , ]
Set_addr_and_waits
 [ 56832 , -236 , ]
Append_Boards_Ready
 [ 56832 , -228 , ]
Append_Boards_Ready
MR3031_GO
0 noop
2* GRAD_VAR +
@
UNSIGNEDTOLONG
2 noop
S>D
 D/
DROP
0 noop
2* GRAD_VAR_L +
!
1 noop
2* GRAD_VAR +
@
UNSIGNEDTOLONG
2 noop
S>D
 D/
DROP
1 noop
2* GRAD_VAR_L +
!
2 noop
2* GRAD_VAR +
@
UNSIGNEDTOLONG
2 noop
S>D
 D/
DROP
2 noop
2* GRAD_VAR_L +
!
3 noop
2* GRAD_VAR +
@
UNSIGNEDTOLONG
2 noop
S>D
 D/
DROP
3 noop
2* GRAD_VAR_L +
!
0 noop
0 noop
0 noop
3 noop
2* GRAD_VAR_L +
@
0 noop
2* GRAD_VAR_L +
@
2 noop
2* GRAD_VAR_L +
@
0 noop
2* GRAD_VAR_L +
@
1 noop
2* GRAD_VAR_L +
@
0 noop
2* GRAD_VAR_L +
@
MR3040_CREATEBASEMATRIX
TEMP_MAC !
TEMP_MAC @
IF
." Could not create base matrix, status = "
TEMP_MAC @
 .
 CR
                                      XGOTO 0
THEN
[ 56832 , 99 , ] us
0 noop
MR3040_SETLISTADDRESS
MR3040_INITLIST
TEMP_3040 !
0 noop
 [ 56832 , 130 , ]
 [ 56832 , 50 , ]
1 noop
MR3040_OUTPUT
 [ 56832 , 255 , ]
0 noop
0 noop
0 noop
CREATEMATRIXTEST
IF
                                      XGOTO 0
THEN
[ 56832 , 99 , ] us
 [ 56832 , 511 , ]
0 noop
0 noop
0 noop
CREATEMATRIXTEST
IF
                                      XGOTO 0
THEN
[ 56832 , 99 , ] us
TEMP_3040 @
 [ 56832 , 546 , ]
MR3040_SETLIST
 [ 56832 , 255 , ]
MR3040_SELECTMATRIX
 [ 56832 , 546 , ]
MR3040_START
[ 56832 , 999 , ] us
SYNC
0 noop
COMPLETED_AV !
LABEL 1
HOSTREQUEST
drop
0 noop
[ 56832 , 16 , ] 15 f!
[ 56832 , 0 , ] 15 f@
   
0 noop
 >
IF
4 noop
[ 56832 , 16 , ] 15 f!
THEN
1 noop
FREQUENCY_BUFFER
[ 56832 , 26 , ] 15 f@
[ 56832 , 28 , ] 15 f@
[ 56832 , 30 , ] 15 f@
[ 56832 , 32 , ] 15 f@
FREQUENCY
[ 56832 , 34 , ] 15 f@
OFFSET_FREQUENCY
0 noop
FREQUENCY_BUFFER
[ 56832 , 26 , ] 15 f@
[ 56832 , 28 , ] 15 f@
[ 56832 , 30 , ] 15 f@
[ 56832 , 32 , ] 15 f@
FREQUENCY
[ 56832 , 2 , ] 15 f@
   
TRADD @
 -
TREXTEND !
TREXTEND @
   
0 noop
 <
IF
 CR
." Relaxation time "
TREXTEND @
 0-
 .
."  ms too short"
                                      XGOTO 0
THEN
COMPLETED_AV @
PHASE_CYCLE @
AQPHASE
PHASE
TREXTEND @
0.8us ms
RESYNC
TRAMP @
   
5 noop
 /
CLOCK !
CLOCK @
MR3040_CLOCK
TRAMP @
   
24 noop
   
WARMUP @
 +
 -
TEMP_MAC !
TEMP_MAC @
 2- us 0.7us
0 noop
0 noop
 [ 56832 , -232 , ]
Set_board_Multipliers
[ 56832 , 88 , ] 15 f@
0 noop
 [ 56832 , -240 , ]
Set_board_Multipliers
0 noop
20 noop
 [ 56832 , -236 , ]
 [ 56832 , -228 , ]
Set_addr_and_waits
 [ 56832 , -236 , ]
Append_Boards_Ready
 [ 56832 , -228 , ]
Append_Boards_Ready
0 noop
RFAMPON
WARMUP @
 2- us 0.7us
[ 56832 , 16 , ] 15 f@
RFON
MR3031_GO
[ 56832 , 86 , ] 15 f@
   
3 noop
 -
TEMP_MAC !
TEMP_MAC @
 2- us 0.7us
RFOFF
0 noop
0 noop
 [ 56832 , -232 , ]
Set_board_Multipliers
0 noop
0 noop
 [ 56832 , -240 , ]
Set_board_Multipliers
2 noop
20 noop
 [ 56832 , -236 , ]
 [ 56832 , -228 , ]
Set_addr_and_waits
 [ 56832 , -236 , ]
Append_Boards_Ready
 [ 56832 , -228 , ]
Append_Boards_Ready
MR3031_GO
1 noop
FREQUENCY_BUFFER
RESET_FREQUENCY
TRDDEXTEND @
 2- us 0.7us
SAMPLE_PERIOD @
NO_SAMPLES @
ACQUIRE
COMPLETED_AV @
   
1 noop
 +
COMPLETED_AV !
COMPLETED_AV @
   
NO_AVERAGES @
 <
IF
XGOTO 1
THEN
LABEL 0
 ;
